package com.atguigu.lease.web.app.custom.config;

import com.atguigu.lease.web.app.interceptor.AuthenticationInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author yaya
 * @Create 2024/6/5 20:36
 * Description:
 */
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {

    @Value("${app.auth.path-patterns.include}")
    private String[] includePathPatterns;

    @Value("${app.auth.path-patterns.exclude}")
    private String[] excludePathPatterns;

    @Autowired
    private AuthenticationInterceptor authenticationInterceptor;

    // @Override
    // public void addInterceptors(InterceptorRegistry registry) {
    //     registry.addInterceptor(this.authenticationInterceptor)
    //             .addPathPatterns(includePathPatterns).excludePathPatterns(excludePathPatterns);
    // }
}
